home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / gpp-1_42.lha / g++-1.42.0 / Imakefile < prev    next >
Makefile  |  1991-10-19  |  7KB  |  294 lines

  1. /*
  2.  * Copyright (c) 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. /**/#
  24. /**/# g++ compiler
  25. /**/#
  26.  
  27. #if CompileInMachineDepSubdir && !defined(InMachineDepSubdir)
  28. #define IHaveMachineDepSubdirs
  29.  
  30. MakeMachineDepSubdir()
  31. DependMachineDepSubdir()
  32.  
  33. #else
  34.  
  35. CC = gcc
  36. GCCDIR = ${SRC}/../gcc
  37. GCCBIN = # -B${GCCDIR}/
  38. DEBUG = # -g
  39. OPTIM = -O
  40. INCL = -I. -I${SRC} -I${GEN} -I${GCCDIR}
  41. DEFINES =
  42. CFLAGS = ${GCCBIN} ${DEBUG} ${OPTIM} ${INCL} ${DEFINES}
  43. DEPENDCFLAGS = ${INCL} ${DEFINES}
  44. BINDIR = ${LOCALBINDIR}
  45.  
  46. #include <gcc.def>
  47.  
  48. #define make_o(file) @@\
  49. file.o: ${SRC}/file.c @@\
  50.     @${RM} file.o @@\
  51.     ${CC} -c ${CFLAGS} ${SRC}/file.c
  52.  
  53. #define make_gcc_o(file) @@\
  54. file.o: ${GCCDIR}/file.c @@\
  55.     @${RM} file.c file.o @@\
  56.     ${LN} ${GCCDIR}/file.c file.c @@\
  57.     ${CC} -c ${CFLAGS} file.c @@\
  58.     ${RM} file.c
  59.  
  60. #define make_gen_o(file) @@\
  61. file.o: ${GEN}/file.c @@\
  62.     @${RM} file.o @@\
  63.     ${CC} -c ${CFLAGS} ${GEN}/file.c
  64.  
  65. #define src(file) ${SRC}/file.c
  66. #define gcc_src(file) ${GCCDIR}/file.c
  67. #define gen_src(file) ${GEN}/file.c
  68. #define obj(file) file.o
  69.  
  70. CPLUS_SRC = \
  71.     src(lastfile) \
  72.     src(cplus-decl) \
  73.     src(cplus-decl2) \
  74.     src(cplus-except) \
  75.     gen_src(cplus-tab) \
  76.     src(cplus-typeck) \
  77.     src(cplus-type2) \
  78.     src(cplus-tree) \
  79.     src(cplus-lex) \
  80.     src(cplus-class) \
  81.     src(cplus-init) \
  82.     src(cplus-method) \
  83.     src(cplus-cvt) \
  84.     src(cplus-search) \
  85.     src(cplus-ptree) \
  86.     src(dbxout) \
  87.     src(expr) \
  88.     src(integrate) \
  89.     src(print-tree) \
  90.     src(stmt) \
  91.     src(stor-layout) \
  92.     src(symout) \
  93.     src(toplev) \
  94.     src(tree) \
  95.     src(varasm) \
  96.     src(version)
  97.  
  98. GCC_SRC = \
  99.     gcc_src(caller-save) \
  100.     gcc_src(combine) \
  101.     gcc_src(cse) \
  102.     gcc_src(emit-rtl) \
  103.     gcc_src(expmed) \
  104.     gcc_src(explow) \
  105.     gcc_src(final) \
  106.     gcc_src(flow) \
  107.     gcc_src(fold-const) \
  108.     gcc_src(global-alloc) \
  109.     gcc_src(jump) \
  110.     gcc_src(local-alloc) \
  111.     gcc_src(loop) \
  112.     gcc_src(obstack) \
  113.     gcc_src(optabs) \
  114.     gcc_src(recog) \
  115.     gcc_src(regclass) \
  116.     gcc_src(reload) \
  117.     gcc_src(reload1) \
  118.     gcc_src(rtl) \
  119.     gcc_src(rtlanal) \
  120.     gcc_src(sdbout) \
  121.     gcc_src(stupid)
  122.  
  123. SRCS = ${CPLUS_SRC} ${GCC_SRC}
  124.  
  125. CPLUS_OBJS = \
  126.     obj(lastfile) \
  127.     obj(cplus-decl) \
  128.     obj(cplus-decl2) \
  129.     obj(cplus-except) \
  130.     obj(cplus-tab) \
  131.     obj(cplus-typeck) \
  132.     obj(cplus-type2) \
  133.     obj(cplus-tree) \
  134.     obj(cplus-lex) \
  135.     obj(cplus-class) \
  136.     obj(cplus-init) \
  137.     obj(cplus-method) \
  138.     obj(cplus-cvt) \
  139.     obj(cplus-search) \
  140.     obj(cplus-ptree) \
  141.     obj(dbxout) \
  142.     obj(expr) \
  143.     obj(integrate) \
  144.     obj(print-tree) \
  145.     obj(stmt) \
  146.     obj(stor-layout) \
  147.     obj(symout) \
  148.     obj(toplev) \
  149.     obj(tree) \
  150.     obj(varasm) \
  151.     obj(version)
  152.  
  153. GCC_OBJS = \
  154.     obj(caller-save) \
  155.     obj(combine) \
  156.     obj(cse) \
  157.     obj(emit-rtl) \
  158.     obj(expmed) \
  159.     obj(explow) \
  160.     obj(final) \
  161.     obj(flow) \
  162.     obj(fold-const) \
  163.     obj(global-alloc) \
  164.     obj(jump) \
  165.     obj(local-alloc) \
  166.     obj(loop) \
  167.     obj(obstack) \
  168.     obj(optabs) \
  169.     obj(recog) \
  170.     obj(regclass) \
  171.     obj(reload) \
  172.     obj(reload1) \
  173.     obj(rtl) \
  174.     obj(rtlanal) \
  175.     obj(sdbout) \
  176.     obj(stupid)
  177.  
  178. INSN_OBJS = \
  179.     obj(insn-emit) \
  180.     obj(insn-peep) \
  181.     obj(insn-recog) \
  182.     obj(insn-extract) \
  183.     obj(insn-output)
  184.  
  185. OBJS = ${CPLUS_OBJS} ${GCC_OBJS} ${INSN_OBJS}
  186.  
  187. ComplexProgramTarget(cc1plus)
  188.  
  189. ${OBJS}: config.h
  190.  
  191. config.h:
  192.     ln -s ${GCCDIR}/config/xm-${TARGET}.h config.h
  193.     ln -s ${GCCDIR}/config/tm-${TARGET}.h tm.h
  194.     ln -s ${GCCDIR}/config/${TARGET}.md md
  195.     ln -s ${GCCDIR}/config/out-${TARGET}.c aux-output.c
  196.     ln -s ${GCCDIR}/move-if-change
  197.     ln -s ${GCCDIR}/machmode.def
  198.     ln -s ${GCCDIR}/stab.def
  199.  
  200. ${GEN}/cplus-tab.c: ${SRC}/cplus-parse.y
  201.     bison -d ${SRC}/cplus-parse.y
  202.     mv cplus-parse.tab.c ${GEN}/cplus-tab.c
  203.     mv cplus-parse.tab.h ${GEN}/cplus-tab.h
  204.  
  205. clean::
  206.     ${RM} config.h tm.h md aux-output.c move-if-change \
  207.         machmode.def stab.def
  208.  
  209. make_o(lastfile)
  210. make_o(cplus-decl)
  211. make_o(cplus-decl2)
  212. make_o(cplus-except)
  213. make_gen_o(cplus-tab)
  214. make_o(cplus-typeck)
  215. make_o(cplus-type2)
  216. make_o(cplus-tree)
  217. make_o(cplus-lex)
  218. make_o(cplus-class)
  219. make_o(cplus-init)
  220. make_o(cplus-method)
  221. make_o(cplus-cvt)
  222. make_o(cplus-search)
  223. make_o(cplus-ptree)
  224. make_o(dbxout)
  225. make_o(expr)
  226. make_o(integrate)
  227. make_o(print-tree)
  228. make_o(stmt)
  229. make_o(stor-layout)
  230. make_o(tree)
  231. make_o(symout)
  232. make_o(toplev)
  233. make_o(varasm)
  234. make_o(version)
  235.  
  236. make_gcc_o(caller-save)
  237. make_gcc_o(combine)
  238. make_gcc_o(cse)
  239. make_gcc_o(emit-rtl)
  240. make_gcc_o(expmed)
  241. make_gcc_o(explow)
  242. make_gcc_o(final)
  243. make_gcc_o(flow)
  244. make_gcc_o(fold-const)
  245. make_gcc_o(global-alloc)
  246. make_gcc_o(jump)
  247. make_gcc_o(local-alloc)
  248. make_gcc_o(loop)
  249. make_gcc_o(obstack)
  250. make_gcc_o(optabs)
  251. make_gcc_o(recog)
  252. make_gcc_o(regclass)
  253. make_gcc_o(reload)
  254. make_gcc_o(reload1)
  255. make_gcc_o(rtl)
  256. make_gcc_o(rtlanal)
  257. make_gcc_o(sdbout)
  258. make_gcc_o(stupid)
  259.  
  260. #if defined(__STDC__)
  261. #define concat(a,b)a##b
  262. #else
  263. #define concat(a,b)a/**/b
  264. #endif
  265.  
  266. GENOBJS = rtl.o obstack.o
  267.  
  268. #define make_gen(name,suf) @@\
  269. insn-name.suf: stamp-name.suf ; @@\
  270. stamp-name.suf: md concat(gen,name) @@\
  271.     ./concat(gen,name) md > tmp-insn-name.suf @@\
  272.     ./move-if-change tmp-insn-name.suf insn-name.suf @@\
  273.     touch stamp-name.suf @@\
  274. @@\
  275. concat(gen,name): concat(gen,name).o ${GENOBJS} @@\
  276.     $(CC) $(LDFLAGS) -o concat(gen,name) concat(gen,name).o ${GENOBJS} @@\
  277. @@\
  278. make_gcc_o(concat(gen,name))
  279.  
  280. make_gen(config,h)
  281. make_gen(flags,h)
  282. make_gen(codes,h)
  283. make_gen(emit,c)
  284. make_gen(recog,c)
  285. make_gen(extract,c)
  286. make_gen(peep,c)
  287. make_gen(output,c)
  288.  
  289. clean::
  290.     ${RM} stamp-* insn-* \
  291.         genflags gencodes genemit genrecog genextract genpeep genoutput
  292.  
  293. #endif /* if compiling in subdirectory */
  294.